package com.example.pointkeeper;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Toast;
import br.ufc.great.model.Point;

public class MainActivity extends Activity {
	
	private ArrayList<Point> pts;
	Intent it;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		pts = new ArrayList<Point>();
		it = new Intent();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	public void onClickStartService(View view){
		Toast t = Toast.makeText(getApplicationContext(), "Tentando", Toast.LENGTH_SHORT);
		t.show();
		Intent service = new Intent(getApplicationContext(), ServicePointKeeper.class);
		getApplicationContext().startService(service); 
		
	}
	
	public void onClickStopService(View view){
		Toast t = Toast.makeText(getApplicationContext(), "Tentando parar", Toast.LENGTH_SHORT);
		t.show();
		stopService(new Intent(MainActivity.this, ServicePointKeeper.class));
		
		
	}

	public void setArrayPoints(ArrayList<Point> points){
		this.pts = points;
	}
	
	public ArrayList<Point> getArrayPoints(){
		return pts;
	}

}
